import React from "react";
import { TouchableHighlight, Text, View, StyleSheet } from "react-native";

const CusBtn = React.forwardRef(
  ({ text, onPress }: { text: string; onPress?: () => void }, ref) => {
    return (
      <TouchableHighlight
        onPress={onPress}
        style={styles.defaultBtn}
        activeOpacity={0.8}
        underlayColor="rgba(0, 128, 128,0.5)"
      >
        <Text style={styles.defaultBtnText}>{text}</Text>
      </TouchableHighlight>
    );
  }
);
export default CusBtn;

const styles = StyleSheet.create({
  defaultBtn: {
    padding: 10,
    borderWidth: 2,
    borderRadius: 10,
    borderColor: "#007aff",
    backgroundColor: "teal",
  },
  defaultBtnText: {
    color: "#fff",
  },
});
